package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "dic_code", schema = "", catalog = "onedollar")
public class DicCodeEntity {
    private int id;
    private String groupId;
    private String code;
    private String name;
    private String priotity;
    private String other1;
    private String other2;
    private String other3;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "group_id", nullable = true, insertable = true, updatable = true, length = 40)
    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    @Basic
    @Column(name = "code", nullable = true, insertable = true, updatable = true, length = 20)
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Basic
    @Column(name = "name", nullable = true, insertable = true, updatable = true, length = 50)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "priotity", nullable = true, insertable = true, updatable = true, length = 2)
    public String getPriotity() {
        return priotity;
    }

    public void setPriotity(String priotity) {
        this.priotity = priotity;
    }

    @Basic
    @Column(name = "other1", nullable = true, insertable = true, updatable = true, length = 20)
    public String getOther1() {
        return other1;
    }

    public void setOther1(String other1) {
        this.other1 = other1;
    }

    @Basic
    @Column(name = "other2", nullable = true, insertable = true, updatable = true, length = 65535)
    public String getOther2() {
        return other2;
    }

    public void setOther2(String other2) {
        this.other2 = other2;
    }

    @Basic
    @Column(name = "other3", nullable = true, insertable = true, updatable = true, length = 20)
    public String getOther3() {
        return other3;
    }

    public void setOther3(String other3) {
        this.other3 = other3;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DicCodeEntity that = (DicCodeEntity) o;

        if (id != that.id) return false;
        if (groupId != null ? !groupId.equals(that.groupId) : that.groupId != null) return false;
        if (code != null ? !code.equals(that.code) : that.code != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (priotity != null ? !priotity.equals(that.priotity) : that.priotity != null) return false;
        if (other1 != null ? !other1.equals(that.other1) : that.other1 != null) return false;
        if (other2 != null ? !other2.equals(that.other2) : that.other2 != null) return false;
        if (other3 != null ? !other3.equals(that.other3) : that.other3 != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (groupId != null ? groupId.hashCode() : 0);
        result = 31 * result + (code != null ? code.hashCode() : 0);
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (priotity != null ? priotity.hashCode() : 0);
        result = 31 * result + (other1 != null ? other1.hashCode() : 0);
        result = 31 * result + (other2 != null ? other2.hashCode() : 0);
        result = 31 * result + (other3 != null ? other3.hashCode() : 0);
        return result;
    }
}
